home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / netinclude / arpa / tftp.h < prev   
C/C++ Source or Header  |  1994-10-03  |  1KB  |  51 lines

  1. #ifndef ARPA_TFTP_H
  2. #define    ARPA_TFTP_H \
  3.        "$Id: tftp.h,v 4.1 1994/10/03 20:54:48 ppessi Exp $"
  4. /*
  5.  *      Trivial File Transfer Protocol (IEN-133)
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. #define    SEGSIZE        512        /* data segment size */
  13.  
  14. /*
  15.  * Packet types.
  16.  */
  17. #define    RRQ    01            /* read request */
  18. #define    WRQ    02            /* write request */
  19. #define    DATA    03            /* data packet */
  20. #define    ACK    04            /* acknowledgement */
  21. #define    ERROR    05            /* error code */
  22.  
  23. struct    tftphdr {
  24.     short    th_opcode;        /* packet type */
  25.     union {
  26.         short    tu_block;    /* block # */
  27.         short    tu_code;    /* error code */
  28.         char    tu_stuff[1];    /* request packet stuff */
  29.     } th_u;
  30.     char    th_data[1];        /* data or error string */
  31. };
  32.  
  33. #define    th_block    th_u.tu_block
  34. #define    th_code        th_u.tu_code
  35. #define    th_stuff    th_u.tu_stuff
  36. #define    th_msg        th_data
  37.  
  38. /*
  39.  * Error codes.
  40.  */
  41. #define    EUNDEF        0        /* not defined */
  42. #define    ENOTFOUND    1        /* file not found */
  43. #define    EACCESS        2        /* access violation */
  44. #define    ENOSPACE    3        /* disk full or allocation exceeded */
  45. #define    EBADOP        4        /* illegal TFTP operation */
  46. #define    EBADID        5        /* unknown transfer ID */
  47. #define    EEXISTS        6        /* file already exists */
  48. #define    ENOUSER        7        /* no such user */
  49.  
  50. #endif /* !ARPA_TFTP_H */
  51.